package xiaohu.day9.HJ92;

import java.util.Arrays;
import java.util.Scanner;

public class Main {
    public static void main(String[] args) {
        Scanner scanner = new Scanner(System.in);
        while (scanner.hasNextLine()) {
            String str = scanner.nextLine();
            int[] maxLength = new int[str.length() + 1];
            for (int i = 1; i <=str.length(); i++) {
                if (Character.isDigit(str.charAt(i-1))) {
                    maxLength[i] = maxLength[i - 1] + 1;
                }
            }
            int max= 0;
            for (int i = 0; i <=str.length(); i++) {
                if (maxLength[i] > max) {
                    max = maxLength[i];
                }
            }
            for (int i = 0; i <=str.length(); i++) {
                if (maxLength[i] == max) {
                    for (int j = i-max; j<i ; j++) {
                        System.out.print(str.charAt(j));
                    }
                }
            }
            System.out.println(","+max);
        }
    }
}
